Skip to content

Feature/SampledCoordinate + Refactoring#53

Open
atrabattoni wants to merge 64 commits intodevfrom
feature/fixed-sampling-rate-coordinates
Open

Feature/SampledCoordinate + Refactoring#53
atrabattoni wants to merge 64 commits intodevfrom
feature/fixed-sampling-rate-coordinates

Conversation

@atrabattoni
Copy link
Contributor

Adds a new SampledCoordinate coordinate type with fixed sampling interval.

This coordinate types is more similar to what used in seismology: one unique sampling rate, several starts associated with number of continuous points.

| S1 - - - - - - - | S2 - - - - | S3 - - - - - - - - - - - - |
         N1              N2                    N3
Delta = -

This new coordinate type is closer to the original data layout, have a better defined unique sampling interval but does not natively deals with gaps and overlaps. Those are determined a posteriori using a given tolerance.

This PR make some important refactoring of the Coordinate part by making defining a clearer API that every coordinate type must follow

InterpCoordinated is still the default for now, but the user can chose to try this coordinate system by using the ctype kwarg:

xd.open_dataarray("path", engine="format", ctype={"time": "sampled", "distance": interpolated"})

TODO:

  • Code
  • Tests
  • Docs
  • Release note entry

@atrabattoni atrabattoni self-assigned this Jan 14, 2026
@atrabattoni atrabattoni added the enhancement New feature or request label Jan 14, 2026
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 88.77375% with 130 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.21%. Comparing base (3ffb6be) to head (0ebb613).

Files with missing lines Patch % Lines
xdas/coordinates/default.py 46.26% 36 Missing ⚠️
xdas/coordinates/core.py 91.07% 29 Missing ⚠️
xdas/coordinates/interp.py 93.80% 15 Missing ⚠️
xdas/coordinates/dense.py 82.85% 12 Missing ⚠️
xdas/io/core.py 11.11% 8 Missing ⚠️
xdas/io/febus.py 40.00% 6 Missing ⚠️
xdas/io/apsensing.py 42.85% 4 Missing ⚠️
xdas/io/terra15.py 42.85% 4 Missing ⚠️
xdas/coordinates/scalar.py 92.50% 3 Missing ⚠️
xdas/io/asn.py 62.50% 3 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #53      +/-   ##
==========================================
+ Coverage   81.91%   83.21%   +1.29%     
==========================================
  Files          37       43       +6     
  Lines        4170     4564     +394     
==========================================
+ Hits         3416     3798     +382     
- Misses        754      766      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant